package com.lzj.demo.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.lzj.demo.dto.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.cursor.Cursor;

import java.util.List;

@Mapper
public interface StudentMapper extends BaseMapper<Student> {
    @Select("select * from student limit #{limit}")
    Cursor<Student> scan(@Param("limit") int limit);

    @Select("select * from student ${ew.customSqlSegment}")
    List<Student> getAll(@Param(Constants.WRAPPER) Wrapper wrapper);

    List<Student> getAll2(Wrapper ew);
}
